﻿using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TT.Test.Fake
{
    internal class FakeDbContext : Logic.Interfaces.ITTContext, IDisposable
    {

        public FakeDbContext()
        {
            this.Matches = new FakeDbSet<Logic.Entities.Match>();
            this.Players = new FakeDbSet<Logic.Entities.Player>();
            this.Tournaments = new FakeDbSet<Logic.Entities.Tournament>();
            this.Rounds = new FakeDbSet<Logic.Entities.Round>();
        }     

        public IDbSet<Logic.Entities.Match> Matches { get; set; }

        public IDbSet<Logic.Entities.Player> Players { get; set; }

        public IDbSet<Logic.Entities.Tournament> Tournaments { get; set; }

        public IDbSet<Logic.Entities.Round> Rounds { get; set; }

        public int SaveChanges()
        {

            //do nothing
            return 0;
        }

        public System.Data.Entity.Infrastructure.DbEntityEntry Entry(object entity)
        {
            return null;
        }

        public System.Data.Entity.Infrastructure.DbEntityEntry<TEntity> Entry<TEntity>(TEntity entity) where TEntity : class
        {
            return null;
        }

        public void Dispose()
        {
            
        }
    }
}
